package cn.lastjune.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.lastjune.dao.CaseDao;
import cn.lastjune.pojo.Case;
import cn.lastjune.service.CaseService;
import cn.lastjune.util.Page;

@Service
@Transactional
public class CaseServiceImpl implements CaseService
{
    @Autowired
    CaseDao dao;

    @Override
    public Page<Case> getAllCase(Page<Case> page)
    {
        return dao.getPageAll(page);
    }

    @Override
    public Case getCaseById(String id)
    {

        return dao.get(id);
    }

    @Override
    public void insertCase(Case entity)
    {
        dao.add(entity);
    }

    @Override
    public void deleteCase(String id)
    {
        dao.delete(id);
    }

    @Override
    public void updateCase(Case entity)
    {
        System.out.println(entity.getMission().getTasknum());

        dao.update(entity);
    }

}
